﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;

namespace GridRegulator
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                String fnbmp;
                if (args.Length == 0) fnbmp = "in.bmp";
                else fnbmp = args[0];
                Bitmap bmp = Bitmap.FromFile(fnbmp) as Bitmap;

                TileMatcher tm = new TileMatcher();
                tm.Match(bmp);

                Console.WriteLine(tm.ToString());

            }
            catch (Exception e)
            {
                Console.WriteLine(": Program error, detail: ");
                Console.WriteLine(e);
            }
        }
    }
}
